package com.zdft.promotion.common.util;

/**
 * Created by Administrator on 2019/2/21.
 */
public class ExceptionUtil
{
    public static String toString(Throwable throwable)
    {
        StringBuilder builder = new StringBuilder();
        builder.append(throwable.toString()).append('\n');
        StackTraceElement[] elements = throwable.getStackTrace();
        for (StackTraceElement element : elements)
        {
            builder.append("  ").append(element.toString()).append('\n');
        }
        return builder.toString();
    }
}
